DEMO: A return statement allows variables created inside a function to be used elsewhere in the program!
You must store the value from a return statement in a new return variable on the function call line.
- Click Run to see a function with a return statement. Follow the onstage directions to complete the demo.
- At the end of the demo, you will be asked a question about the value stored in a return variable!
- Click Submit and Next to answer more questions about function returns in the next activity.
To navigate the page using the TAB key, first press ESC to exit the code editor.